package com.witype.timeline;

import com.witype.timeline.line.DataUtils;
import com.witype.timeline.line.PlayLine;

import java.util.ArrayList;

/**
 * Created by WiType on 2017/4/16.
 * Email witype716@gmail.com
 * Desc:
 */

public class Sence implements PlayLine {

    private long beginTime;
    private long endTime;
    private long eachTime;
    private String name;

    private ArrayList<Sprite> sprites = new ArrayList<>(0);

    public Sence(long beginTime, long endTime, long eachTime) {
        this.beginTime = beginTime;
        this.endTime = endTime;
        this.eachTime = eachTime;
    }

    public Sence(String name,String beginTime, String endTime, long eachTime) {
        this.name = name;
        this.beginTime = DataUtils.convertString2Milli(beginTime);
        this.endTime = DataUtils.convertString2Milli(endTime);
        this.eachTime = eachTime;
    }

    public void addSprite(int minFromNow) {
        sprites.add(new Sprite(minFromNow));
    }

    public ArrayList<Sprite> getSprites() {
        return sprites;
    }

    public String getName() {
        return name;
    }

    @Override
    public long getBeginTimestamp() {
        return beginTime;
    }

    @Override
    public long getEndTimestamp() {
        return endTime;
    }

    @Override
    public long getEachTimestamp() {
        return eachTime;
    }
}
